import 'package:flutter_ahj_app/base/pluglin/wxplulin/WxJumpUtils.dart';
import 'package:mop/mop.dart';

class ShareWx{
  static Future<Map<String, dynamic>> doShare(dynamic params) async {
    // 获取参数
    Map map=new Map();
    map["url"]=params['url'];
    map["title"]=params['title'];
    map["description"]=params['desc'];
    map["shareType"]=params['type'];

    // 追加 FinClip 的app id
     Map<String, dynamic> currentApplet = await Mop.instance.currentApplet();
     if (currentApplet != null && currentApplet["data"]!=null && currentApplet["data"].containsKey("appId")) {
       var appId= currentApplet["data"]["appId"];
       map["appId"]=appId;
     }

    // 去启动
    WxJumpUtils.wxSharePicProgram(map);

    return {"success": true};
  }
}